package com.panshi.api;

import com.panshi.vo.ArticleOkVO;
import com.panshi.vo.TitleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@FeignClient(value = "zx-server", contextId = "zx")
public interface ZxApi {

    @GetMapping("/zx/title")
    @ResponseBody
    List<TitleVO> listTitleVOs();

    @GetMapping("/zx/load/{page}")
    List<ArticleOkVO> listArticleOkVOs(@PathVariable int page);

    @PostMapping("/zx/recommend/{page}/{sort}")
    List<ArticleOkVO> listRecommendArticleOkVOs(@PathVariable String page, @PathVariable String sort);

    @GetMapping("/zx/page/{sort}")
    int countRecommendPage(@PathVariable int sort);

    //获取所有资讯条数
    @GetMapping("/zx/page")
    int countNewsPage();

    //其他看点
    @GetMapping("/zx/other")
    List<ArticleOkVO> listOtherArticleOkVOs();

    @GetMapping("zx/sort/allwatch")
    @ResponseBody
    List<ArticleOkVO> listAllWatchArticleOkVOs();

    @GetMapping("/zx/sort/recommend/{id}")
    List<ArticleOkVO> listRelatedRecommendArticleOkVOs(@PathVariable int id);


    @GetMapping("/zx/sort/load/{type}/{page}/{sort}")
    List<ArticleOkVO> listSortLoadArticleOkVOs(@PathVariable int type, @PathVariable int page, @PathVariable int sort);


    @GetMapping("/zx/sort/load/{type}/{page}")
    List<ArticleOkVO> listZxLoadArticleOkVOs(@PathVariable int type, @PathVariable int page);


    @GetMapping("/zx/sort/hot/{page}/{sort}")
    List<ArticleOkVO> listHotArticleOkVOs(@PathVariable int page, @PathVariable int sort);


    @GetMapping("/zx/sort/new/{page}/{sort}")
    List<ArticleOkVO> listNewArticleOkVOs(@PathVariable int page, @PathVariable int sort);


}
